package com.jci.vsd.network.control;

import android.content.Context;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jci.vsd.application.VsdApplication;
import com.jci.vsd.bean.download.CheckUpdateResponse;
import com.jci.vsd.bean.download.FileCallBack;
import com.jci.vsd.bean.download.FileSubscriber;
import com.jci.vsd.constant.AppConstant;
import com.jci.vsd.exception.IApiException;
import com.jci.vsd.network.api.DownloadApi;
import com.jci.vsd.utils.Loger;
import com.jci.vsd.view.widget.SimpleToast;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Function;
import okhttp3.ResponseBody;
import retrofit2.Retrofit;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.schedulers.Schedulers;

/**
 * Created by Administrator on 2017/11/20 0020.
 */

public class DownloadFileControl extends BaseControl {

    public rx.Observable<ResponseBody> downloadReimFile(String url) {
        Retrofit retrofit = buildDownloadRetrofit();
        DownloadApi downloadApi = retrofit.create(DownloadApi.class);
        return downloadApi.download1(url);
    }


    public rx.Observable<ResponseBody> downloadReimFileWithToken(String url) {
        Retrofit retrofit = buildDownloadWithTokenRetrofit();
        DownloadApi downloadApi = retrofit.create(DownloadApi.class);
        return downloadApi.download1(url);
    }



}
